// 配置厂库
import Vue from "vue";
import Vuex from "vuex";
// 持久化存储 vuex
import createPersistedState from "vuex-persistedstate";
// 需要使用一次
Vue.use(Vuex);

// 引入小仓库
import users from "./users";
import walls from "./walls";
import request from "./request";
import goods from "./goods";
import buys from "./buys";
import chat from "./chat";

export default new Vuex.Store({
  // 实现模块化处理数据
  modules: {
    users,
    walls,
    request,
    goods,
    buys,
    chat,
  },
  plugins: [
    createPersistedState({
      paths: ["users.token"],
    }),
  ],
});
